package com.example.service.impl;

import com.example.entity.Supply;
import com.example.mapper.SupplyMapper;
import com.example.service.SupplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:tjf
 * @Description:
 */
@CacheConfig(cacheNames = "com.example.service.impl.SupplyServiceImpl")
@Service
public class SupplyServiceImpl implements SupplyService {
    @Autowired
    private SupplyMapper supplyMapper;

    /**
     * 查询所有供应商的业务方法
     * @return
     */
    @Cacheable(key = "'supply:all'")
    @Override
    public List<Supply> queryAllSupply() {
        return supplyMapper.selectAllSupply();
    }
}
